package service.impl;

import dao.BlogDao;
import dao.impl.BlogDaoImpl;
import entity.Blog;
import service.BlogService;
import util.Page;

import java.util.List;

public class BlogServiceImpl implements BlogService {
    BlogDao blogDao=new BlogDaoImpl();

    @Override
    public int getBlogCount(int uid) {
        return blogDao.getBlogCount(uid);
    }

    @Override
    public List<Blog> getBlogList(int uid, String content) {
        return blogDao.getBlogList(uid, content);
    }

    @Override
    public List<Blog> getAllBlogList(int uid1, String content1, int uid2, String content2, Page page) {
        List<Blog> blogList=blogDao.getAllBlogList(uid1, content1, uid2, content2, page);
        //总记录数
        int count=blogDao.allCount(uid1, content1, uid2, content2);
        //赋值
        page.setTotalCount(count);
        return blogList;
    }

    @Override
    public Blog getBlogById(int bid) {
        return blogDao.getBlogById(bid);
    }
}
